package teaching.io.temp;

import java.io.File;
import java.io.FilenameFilter;

class MyFilter implements FilenameFilter {
	private String type;

	public MyFilter(String type) {
		super();
		this.type = type;
	}

	@Override
	public boolean accept(File dir, String name) {
		return (name.toUpperCase()).endsWith(type.toUpperCase());
	}

}

public class FileExample {

	public static void main(String[] args) {
		File file = new File("d:/data");
		System.out.println(file.isDirectory());
		for (String string : file.list(new MyFilter("dbf"))) {
			System.out.println(string);
		}
	}
}
